<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<table width="750"  cellpadding="0" cellspacing="0" border="0" align="center">
	<c:forEach var="x" begin="0" end="${fn:length(data)-1}" step="1" varStatus ="status">
		<c:if test="${x>=StartingRow && x<=EndingRow}">
		<tr valign="top">
			<td style="padding-left: 20px;"><a href="news_events_full_story.html?id=${data[x].NEWS_ID}"><img src="News_Event_Files/Front_Images/${data[x].FRONT_IMAGE_FILE}" border="0" height=180px width=200px></a></td>
			<td align="left" style="padding-left: 20px;">
				<a href="news_events_full_story.html?id=${data[x].NEWS_ID}" style="font-size: 12px;"><c:out value="${data[x].NEWS_TITLE}"/></a><br/>
				<c:choose>
					<c:when test="${fn:length(data[x].NEWS_DESC)>=800}">
						<p align="justify"><c:out value="${fn:substring(data[x].NEWS_DESC,0,800)}"/>...</p>
						<p align="right"><a href="news_events_full_story.html?id=${data[x].NEWS_ID}">Full Story...</a></p>
					</c:when>
					<c:otherwise>
						<p align="justify"><c:out value="${data[x].NEWS_DESC}"/></p>
					</c:otherwise>
				</c:choose>
			</td>
			<td width="10">&nbsp;</td>
		</tr>
		<tr><td colspan="3">&nbsp;</td></tr>		
		</c:if>
	</c:forEach>
	
	<tr>
		<td colspan="3" height="30" valign="top">
		<c:if test="${PageCount>1}">
			<c:if test="${page>1}">
				<a href="news_events.html?page=${page-1}">Previous</a>
			</c:if>
			<c:if test="${page<=1}">
				<label style="color: #333">Previous</label>
			</c:if>
			
				<c:forEach var="i" begin="1" end="${PageCount}" step="1" varStatus ="status">
					<c:if test="${i==page}">
						<b style="color: #333"><c:out value="${i}" /></b>
					</c:if>
					<c:if test="${i!=page}">
						<a href="news_events.html?page=${i}"><c:out value="${i}" /></a>
					</c:if>
				</c:forEach>
				
			<c:if test="${page<PageCount}">
				<a href="news_events.html?page=${page+1}">Next</a>
			</c:if>
			<c:if test="${page>=PageCount}">
				<label style="color: #333">Next</label>
			</c:if>
		</c:if>
		</td>
	</tr>
</table>
</html>